import 'package:flutter/material.dart';

class BottomNavigationBarCustom extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _BottomNavigationBarCustomState();
  }
}

class _BottomNavigationBarCustomState extends State<BottomNavigationBarCustom> {
  int _currentIndex = 2;

  void _onTapHandler(int index) {
    this.setState(() => {this._currentIndex = index});
  }

  @override
  Widget build(BuildContext context) {
    return new BottomNavigationBar(
      type: BottomNavigationBarType.fixed,
      fixedColor: Colors.black,
      currentIndex: this._currentIndex,
      onTap: _onTapHandler,
      items: [
        new BottomNavigationBarItem(icon: new Icon(Icons.home), label: '我的'),
        new BottomNavigationBarItem(icon: new Icon(Icons.list), label: '我的'),
        new BottomNavigationBarItem(icon: new Icon(Icons.home), label: '首页'),
        new BottomNavigationBarItem(icon: new Icon(Icons.home), label: '我的'),
        new BottomNavigationBarItem(icon: new Icon(Icons.person), label: '我的'),
      ],
    );
  }
}
